<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {if $admin.site_id>0}
    <input id="c-site_id" data-rule="required" name="row[site_id]" style="display: none;" type="text" value="{$admin.site_id}">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="form-inline col-xs-12 col-sm-8" data-toggle="cxselect" data-selects="first,second">
            <select class="first form-control"data-rule="required" name="first" data-url="ajax/category?type=navigation&amp;pid=0&amp;ids=58,63,65">
                <option value="{$row.first|htmlentities}" selected="">{$row.first_name|htmlentities}</option>
            </select>
            <select class="second form-control" data-rule="required" name="second" data-url="ajax/category?site_id={$admin.site_id}" data-query-name="pid">
                <option value="{$row.second|htmlentities}" selected="">{$row.second_name|htmlentities}</option>
            </select>
        </div>
    </div>
    {else /}
    <div class="form-group" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Site_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-site_id"  data-source="user/user/index" data-field="sitename" data-params='{"custom[is_siter]":"1"}' class="form-control selectpage" name="row[site_id]" type="text" value="{$row.site_id|htmlentities}" placeholder="不选即为主站">
        </div>
    </div>
    <div class="form-group" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="form-inline col-xs-12 col-sm-8" data-toggle="cxselect" data-selects="first,second">
            <select class="first form-control"data-rule="required" name="first" data-url="ajax/category?type=navigation&amp;pid=0">
                <option value="{$row.first|htmlentities}" selected="">{$row.first_name|htmlentities}</option>
            </select>
            <select class="second form-control" data-rule="required" name="second" data-url="ajax/category?site_id={$admin.site_id}" data-query-name="pid">
                <option value="{$row.second|htmlentities}" selected="">{$row.second_name|htmlentities}</option>
            </select>
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Iconimage')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-iconimage" class="form-control" size="50" name="row[iconimage]" type="text" value="{$row.iconimage|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-iconimage" class="btn btn-danger plupload" data-input-id="c-iconimage" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-iconimage"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-iconimage" class="btn btn-primary fachoose" data-input-id="c-iconimage" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-iconimage"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-iconimage"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-url" class="form-control" data-rule="required" name="row[url]" type="text" value="{$row.url|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Targetdata')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="targetdataList" item="vo"}
            <label for="row[targetdata]-{$key}"><input id="row[targetdata]-{$key}" name="row[targetdata]" type="radio" value="{$key}" {in name="key" value="$row.targetdata"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
